<template>
  <div class="default">
    <div
      v-for="problem in problems"
      :key="problem.id"
    >
      <h3 class="title">{{problem.firstGradeTitle}}</h3>
      <div class="list">
        <div
          class="child"
          v-for="child in problem.secondVOList"
          :key="child.id"
          @click="handleProblemClick(child.id)"
        >
          {{child.title}}
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'HelpCenterDefault',
  props: {
    problems: {
      type: Array,
      default: () => []
    }
  },
  methods: {
    /**
     * 点击问题
     */
    handleProblemClick (id) {
      this.$router.push({
        path: '/helpcenterdetail',
        query: {
          helpId: id
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.title {
  color: #383d42;
  line-height: 24px;
  margin-bottom: 14px;
  font-weight: bolder;
}
.list {
  display: flex;
  flex-wrap: wrap;
  .child {
    margin: 0 20px 20px 0;
    color: #545c63;
    font-size: 14px;
    &:hover {
      cursor: pointer;
      color: $primary;
    }
  }
}
</style>
